import { BaseEntity } from '@cool-midway/core';
import { Column, Entity, Index } from 'typeorm';

/**
 * tasksystem模块-任务信息
 */
@Entity('tasksystem_task_info')
export class TaskSystemTaskInfoEntity extends BaseEntity {
  @Index()
  @Column({ comment: '标题' })
  title: string;

  @Column({ comment: '内容', type: 'text' })
  content: string;

  @Column({ comment: '类型 0-普通 1-紧急', default: 0, type: 'tinyint' })
  type: number;

  @Column({ comment: '状态 0-系统通知 1-支付通知', default: 0, type: 'tinyint' })
  status: number;

  @Index()
  @Column({ comment: '发送者' })
  sender: string;

  @Index()
  @Column({ comment: '接收者' })
  receiver: number;

  @Column({ comment: '订单号', nullable: true })
  orderNumber: string;

  @Column({ comment: '时间', type: 'datetime' })
  time: Date;

  @Column({ comment: '优先级 0-低 1-中 2-高', default: 0, type: 'tinyint' })
  priority: number;

  @Column({ comment: '附件', nullable: true, type: 'json' })
  attachments: string[];

  @Column({ comment: '链接', nullable: true })
  link: string;
}
